package com.pagepub.core.exception;

public class ExceptionMessageParam {
	public ExceptionMessageParam(
			String resFileName,
			boolean message,
			String keyOrMessageText,
			Object... params
			)
	{
		this.resFileName=resFileName;
		this.message=message;
		this.key=keyOrMessageText;
		this.params=params;
	}
	public ExceptionMessageParam()
	{
	}
	private String resFileName;
	private boolean message=false;
	private String key;
	private Object[]params;

	/**
	 * 如果message=true此方法无效，message默认false
	 * @return
	 */
	public String getKeyOrMessageText()
	{
		return key;
	}
	/**
	 * 如果message=true此方法无效，message默认false
	 * @param keyOrMessageText 资源文件的key或错误信息内容

	 */
	public void setKeyOrMessageText(String keyOrMessageText)
	{
		if(message)
		{
			this.key=null;
		}
		else
		{
			this.key = keyOrMessageText;
		}

	}
	public boolean isMessage()
	{
		return message;
	}
	public void setMessage(boolean message)
	{
		this.message = message;
	}
	public Object[] getParams()
	{
		return params;
	}
	public void setParams(Object... params)
	{
		this.params = params;
	}
	public String getResFileName()
	{
		return resFileName;
	}
	/**
	 * 如果message=true此方法无效，message默认false
	 * @param resFileName 资源文件路径(包形式的格式如：com.xxx.xxx.ResourceName不含".properties")
	 */
	public void setResFileName(String resFileName)
	{
		this.resFileName = resFileName;
	}
}
